﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutoMapper;
using Data.ModelDatabase;

namespace Data.Mappers
{
    public class OrderPositionMapper : IMapper<Entity.Orders.OrderPosition, ModelDatabase.OrderPosition>
    {
        public Entity.Orders.OrderPosition WrapperData(ModelDatabase.OrderPosition obj)
        {
            Mapper.CreateMap<Category, Entity.Categories.Category>();
            Mapper.CreateMap<Product, Entity.Products.Product>();
            Mapper.CreateMap<OrderPosition, Entity.Orders.OrderPosition>();
            Mapper.CreateMap<User, Entity.Users.User>();

            return Mapper.Map<OrderPosition, Entity.Orders.OrderPosition>(obj);
        }

        public List<Entity.Orders.OrderPosition> WrapperData(List<ModelDatabase.OrderPosition> obj)
        {
            Mapper.CreateMap<Category, Entity.Categories.Category>();
            Mapper.CreateMap<Product, Entity.Products.Product>();
            Mapper.CreateMap<OrderPosition, Entity.Orders.OrderPosition>();
            Mapper.CreateMap<User, Entity.Users.User>();

            return Mapper.Map<List<OrderPosition>, List<Entity.Orders.OrderPosition>>(obj);
        }

        public ModelDatabase.OrderPosition WrapperEntity(Entity.Orders.OrderPosition obj)
        {
            Mapper.CreateMap<Entity.Products.Product, Product>();
            Mapper.CreateMap<Entity.Categories.Category, Category>();
            Mapper.CreateMap<Entity.Orders.OrderPosition, OrderPosition>();
            Mapper.CreateMap<Entity.Users.User, User>();

            return Mapper.Map<Entity.Orders.OrderPosition, OrderPosition>(obj);
        }

        public List<ModelDatabase.OrderPosition> WrapperEntity(List<Entity.Orders.OrderPosition> obj)
        {
            Mapper.CreateMap<Entity.Products.Product, Product>();
            Mapper.CreateMap<Entity.Categories.Category, Category>();
            Mapper.CreateMap<Entity.Orders.OrderPosition, OrderPosition>();
            Mapper.CreateMap<Entity.Users.User, User>();

            return Mapper.Map<List<Entity.Orders.OrderPosition>, List<OrderPosition>>(obj);
        }
    }
}
